from web_server_function.CourseServer import course_server
from web_server_function.ServerUtils import server_utils
from utils.ReadUtil import read_util
import argparse


# if __name__ == '__main__':
#     # 测试教研员登录
#     server_utils.login_background("15055555555", "123456")
#     # 新增用户课程
#     course_server.add_course('高中阶段', '高一', '历史', '专题', '测试教研主管', '刘桐杉')


def main(course_stage_name, video_class_mame, subject_category_name, video_course_category_name, app_rover_user_name,
         teacher_name):
    # 测试教研员登录
    server_utils.login_background(read_util.read_data()['后台账号密码']['测试教研员账号'],
                                  read_util.read_data()['后台账号密码']['测试教研员密码'])
    # 新增用户课程
    course_server.add_course(course_stage_name, video_class_mame, subject_category_name, video_course_category_name,
                             app_rover_user_name, teacher_name)


if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='执行新增课程模块操作')
    parser.add_argument('course_stage_name', type=str, help='课程阶段')
    parser.add_argument('video_class_mame', type=str, help='年级分类')
    parser.add_argument('subject_category_name', type=str, help='学科分类')
    parser.add_argument('video_course_category_name', type=str, help='课程类型')
    parser.add_argument('app_rover_user_name', type=str, help='上级审核人')
    parser.add_argument('teacher_name', type=str, help='讲师')
    args = parser.parse_args()

    main(args.course_stage_name, args.video_class_mame, args.subject_category_name, args.video_course_category_name,
         args.app_rover_user_name, args.teacher_name)
